<?php
	$user_id = Yii::app()->user->getId();
	//Get request friend
	$notification['friend'] = FriendshipController::viewListNotification($user_id);
	echo "<li><strong>Người yêu cầu kết bạn : </strong></li>";
	foreach ($notification['friend'] as $friend)
	{
		$idDiv = 'divNotificationFriendship'.$friend['id'];
		if($friend['read'] ==0){
			echo '<li style="background: #999;" class="'.$idDiv.'">';
		}else{
			echo '<li class="'.$idDiv.'">';
		}

		?>
		      <div style="float: left; clear: left; padding: 3px;height:50px;">
		      	<?php
		      	echo '<a href="'.Yii::app()->request->baseUrl.'/Page/Feed/'.$friend['id'].'">';
				echo '<img src="'.Yii::app()->request->baseUrl.'/themes/fly_high/assets/img/avatar/'.$friend['avatar'].'" width="50px"/>';
		      	?>
		      </div>
		      <div style="height: 50px;">
			    <?php
					echo '<strong style="float: left;margin-top:15px;">';
					echo $friend['name'];
					echo "</strong></a>";
					echo '<div style="float: right;margin-top:13px;"><input id="btnNotificationFriendshipAccept'.$friend['id'].'" type="button" name="acceptRequest" value="Đồng ý" class="noHide" onclick="ajaxRequestFriendship('.$friend['id'].',\'accept\')"/>';
					echo '<input id="btnNotificationFriendshipDeny'.$friend['id'].'" type="button" name="denyRequest" value="Không" class="noHide" onclick="ajaxRequestFriendship('.$friend['id'].',\'deny\')"/></div>';
			    ?>
		      </div>

		</li>
		<?php
	}
?>

<script type="text/javascript">
	var quantityNotificationFriendshipUnRead =<?php echo FriendshipController::getQuantityUnread($user_id);?>;
</script>